//
// CVegetableShape.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CVegetableShape {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CVegetableShape(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CVegetableShape obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CVegetableShape(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CVegetableShape() {
    this(nel3dJNI.new_CVegetableShape(), true);
  }

  public void build(CVegetableShapeBuild vbuild) {
    nel3dJNI.CVegetableShape_build(swigCPtr, this, CVegetableShapeBuild.getCPtr(vbuild), vbuild);
  }

  public boolean loadShape(String shape) {
    return nel3dJNI.CVegetableShape_loadShape(swigCPtr, this, shape);
  }

  public void setLighted(boolean value) {
    nel3dJNI.CVegetableShape_Lighted_set(swigCPtr, this, value);
  }

  public boolean getLighted() {
    return nel3dJNI.CVegetableShape_Lighted_get(swigCPtr, this);
  }

  public void setDoubleSided(boolean value) {
    nel3dJNI.CVegetableShape_DoubleSided_set(swigCPtr, this, value);
  }

  public boolean getDoubleSided() {
    return nel3dJNI.CVegetableShape_DoubleSided_get(swigCPtr, this);
  }

  public void setPreComputeLighting(boolean value) {
    nel3dJNI.CVegetableShape_PreComputeLighting_set(swigCPtr, this, value);
  }

  public boolean getPreComputeLighting() {
    return nel3dJNI.CVegetableShape_PreComputeLighting_get(swigCPtr, this);
  }

  public void setAlphaBlend(boolean value) {
    nel3dJNI.CVegetableShape_AlphaBlend_set(swigCPtr, this, value);
  }

  public boolean getAlphaBlend() {
    return nel3dJNI.CVegetableShape_AlphaBlend_get(swigCPtr, this);
  }

  public void setBestSidedPreComputeLighting(boolean value) {
    nel3dJNI.CVegetableShape_BestSidedPreComputeLighting_set(swigCPtr, this, value);
  }

  public boolean getBestSidedPreComputeLighting() {
    return nel3dJNI.CVegetableShape_BestSidedPreComputeLighting_get(swigCPtr, this);
  }

  public void setBendCenterMode(CVegetableShapeBuild.TBendCenterMode value) {
    nel3dJNI.CVegetableShape_BendCenterMode_set(swigCPtr, this, value.swigValue());
  }

  public CVegetableShapeBuild.TBendCenterMode getBendCenterMode() {
    return CVegetableShapeBuild.TBendCenterMode.swigToEnum(nel3dJNI.CVegetableShape_BendCenterMode_get(swigCPtr, this));
  }

  public void setVB(CVertexBuffer value) {
    nel3dJNI.CVegetableShape_VB_set(swigCPtr, this, CVertexBuffer.getCPtr(value), value);
  }

  public CVertexBuffer getVB() {
    long cPtr = nel3dJNI.CVegetableShape_VB_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CVertexBuffer(cPtr, false);
  }

  public void setTriangleIndices(Vector_uint16 value) {
    nel3dJNI.CVegetableShape_TriangleIndices_set(swigCPtr, this, Vector_uint16.getCPtr(value), value);
  }

  public Vector_uint16 getTriangleIndices() {
    long cPtr = nel3dJNI.CVegetableShape_TriangleIndices_get(swigCPtr, this);
    return (cPtr == 0) ? null : new Vector_uint16(cPtr, false);
  }

  public void setInstanceVertices(Vector_uint16 value) {
    nel3dJNI.CVegetableShape_InstanceVertices_set(swigCPtr, this, Vector_uint16.getCPtr(value), value);
  }

  public Vector_uint16 getInstanceVertices() {
    long cPtr = nel3dJNI.CVegetableShape_InstanceVertices_get(swigCPtr, this);
    return (cPtr == 0) ? null : new Vector_uint16(cPtr, false);
  }

  public void serial(IStream f) {
    nel3dJNI.CVegetableShape_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

}
